<?php
include_once '../comm/config.php';  
include '../comm/checkpostandget.php';
header("Content-type:text/html;charset=utf-8"); 
if($_POST['uname']!=''){
    $sql="select Id,ddusername,email,ddpassword,jihuo from ".$BIAOTOU."user where ddusername='".$_POST['uname']."' limit 1";
	$query=mysql_query($sql);
	$arr=mysql_fetch_array($query);
	$email=$arr['email'];
	$jihuo=$arr['jihuo'];
	$uid=$arr['Id'];
	$name=$arr['ddusername'];
	$md5pwd=$arr['ddpassword'];
	$e=$email;
	if($uid>0 && $jihuo==0){
		$jihuo_code=urlencode(base64_encode($uid.'#'.$name.'#'.$md5pwd));
		$jihuo_url='http://'.URL.'/user/savereg.php?jihuo='.$jihuo_code;
	    $msg_zhuce='您的网站激活链接<a href='.$jihuo_url.'>'.$jihuo_url.'</a>';
		mail_send($email, WEBTITLE.'欢迎您的到来', $msg_zhuce);
	}
	elseif(!$uid){
	    echo "<script language=javascript>alert('账号不存在，请从新输入！');window.history.go(-1);</script>"; 
	    exit;
	}
	elseif($jihuo==1){
	    echo "<script language=javascript>alert('此账号无需激活，可直接登陆！');window.location='login.php';</script>"; 
	    exit;
	}
}
elseif($_GET['e']!=''){
    $e=$_GET['e'];
}

if($e!=''){
    $row=explode('@',$e);
    $web='http://mail.'.$row[1];
	$username=$row[0];
}

$tag="center";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册提交</title>
<link href="../template/<?=MOBAN?>/css/style.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/layout.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/login.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
function tip(id)
{
	if(id==1)
	{
		document.getElementById("tipnav").style.display="block";
	}
	if(id==2)
	{
		document.getElementById("tipnav").style.display="none";
	}
}

function tip1()
{
$("#tipnav").bind("mouseleave",
function()
{
		document.getElementById("tipnav").style.display="none";
}
);
}

</script>

</head>

<body>
<div class='head_warpC'>

    
	<div class='slideup layout_head'>
	<ul class="headerTopLeft">
      <li class="home"><a href="../index.php" onmousemove="tip(1);"  >优米库首页</a></li>
      <li><a href="../comm/shortcut.php">放到桌面</a></li>
      <li><a href="#dd" onClick="AddFavorite('<?=$navheadurl?>','<?=WEBNICK?>')">添加到收藏夹</a></li>
      <li><a href="msg_list.php?act=send">咨询优助手</a></li>
      <li><a href="msg_list.php?act=send">提意见给客服</a></li>
    </ul>

    <ul class="headerTopRight FRight">
      <li class="HUserimg"><img src="../upload/avatar/<?=get_avatar_filepath($_SESSION['dduserid'], $size = 'big')?>" width="40" height="40"></li>
      <li><a href="center.php">我的优米库</a></li>
      <li><a href="register.php">成为米粒</a></li>
      <?php
      if($_SESSION["duoduouser"]==NULL)
      {
          echo "<li><a href=login.php>登录</a></li>";
          echo "<li><a href=center.php>您好，游客".$_SESSION["tmpuser"]."</a></li>";
      }
      else
      {
          echo "<li><a href=exit.php>退出</a></li>";
          echo "<li><a href=center.php>您好，".$_SESSION["duoduouser"]."</a></li>";	
      }
      ?>
    </ul>
<div class="clears"></div>
	</div>  
    <div class="dhmenu" id="tipnav" onmouseout="tip1();" style="display:none">
        <div class="fm">
        <a class="active">攒米</a><a href='../malllist.php'>返米店铺</a><!--<a href='#'>返米宝</a>--><a href='tuiguang_url.php'>免费攒米</a><!--<a href='#'>省钱检测</a>--><a class="active">兑换</a><a href="../huan.php">用米兑换</a><a href="tixian.php">申请提现</a>
        <a href='#' class="active">社区</a><a href='../baobeilist.php'>米粒晒吧</a>
        <br /><a class="active">店铺</a><a href='#'>优米联盟</a>
       </div>
   </div>
    
    
    <div class="quickNav">
    </div>

    <div class="layout_head reg">
     <a href="#" class="logo_reg"><img src="../template/<?=MOBAN?>/images/logo_zhuce.png" width="226" height="57" /></a>
    <ul class="reg_enter" style="margin-top:40px">
      <li><a href="getpassword.php">找回密码</a></li>
      <li><a href="login.php">登录</a></li>
    <li><img src="../template/<?=MOBAN?>/images/creatUser.png" width="102" height="24" /></li>
    </ul>
        
        
    </div>
    

</div>
<div class='layout_body MarginT10'>

<h3 class="LineHeight32 col14red MarginT10">您好，<?=$username?></h3>

<div class="reg_sec">
<ul class="reg_ul">
<li class="MarginT10 MarginB10 Fnone"><h3 align="center" class="Font14">注册成功，请立即认证帐户</h3></li>
<li class="Fnone"><span class="ColorRed"><strong><?=$e?></strong></span> 将收到一封认证邮件，<br />请查收
成功认证后，你就可以登录优米库，轻松攒米了哦~~</li>
<li class="MarginTB30"><a href="<?=$web?>" target="_blank"><img src="../template/<?=MOBAN?>/images/lkyz.jpg" width="277" height="56" /></a></li>
</ul>
<div class="clears"></div>
<ul class="norecive">
<li><strong>没有收到邮件？</strong></li>
<li>1，到垃圾邮件目录里找找</li>
<!--<li>2，用<?=$e?>m向hi@umiku.com发送一封任意邮件，几分钟后即可完成认证！</li>-->
<li>2，重新换个邮箱注册</li>
</ul>
</div>
<div class="clears"></div>
</div>

<?php
include("../template/".MOBAN."/footer.tpl.php");
mysql_close();
?>
</body>
</html>
